package com.yboot.module.system.model.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yboot.starter.common.core.web.validation.InsertGroup;
import com.yboot.starter.common.core.web.validation.UpdateGroup;
import com.yboot.starter.mybatis.core.base.entity.BaseEntity;

import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;

/**
 * 角色表
 * @author yangcs
 * @date 2025-08-29
 */
@EqualsAndHashCode(callSuper = true)
@Data
@TableName("sys_role")
public class SysRoleEntity extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * ID
     */
    @NotBlank(message = "id不能为空", groups = {UpdateGroup.class})
    private String id;
    /**
     * 名称
     */
    @NotBlank(message = "name不能为空", groups = {InsertGroup.class, UpdateGroup.class})
    private String name;
    /**
     * 编码
     */
    @NotBlank(message = "code不能为空", groups = {InsertGroup.class, UpdateGroup.class})
    private String code;
    /**
     * 数据权限（1：全部数据权限；2：本部门及以下数据权限；3：本部门数据权限；4：仅本人数据权限；5：自定义数据权限）
     */
    @NotBlank(message = "dataScope不能为空", groups = {InsertGroup.class, UpdateGroup.class})
    private String dataScope;
    /**
     * 描述
     */
    private String description;
    /**
     * 排序
     */
    @NotNull(message = "sort不能为空", groups = {InsertGroup.class, UpdateGroup.class})
    private Integer sort;
    /**
     * 是否为系统内置数据
     */
    @NotNull(message = "isSystem不能为空", groups = {InsertGroup.class, UpdateGroup.class})
    private Boolean isSystem;
    /**
     * 菜单选择是否父子节点关联
     */
    private Boolean menuCheckStrictly;
    /**
     * 部门选择是否父子节点关联
     */
    private Boolean deptCheckStrictly;
    /**
     * 删除标识
     */
    private String deleteFlag;
}
